﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;

namespace HCQ2_Model.VRDD.InputDto._20220314
{
    /// <summary>
    ///  审核素材商品信息
    /// </summary>
    public class CheckMaterialInput
    {
        /// <summary>
        ///  素材缩略图在文件服务器的访问地址
        /// </summary>
        [Required(ErrorMessage = "imageUrl：必传项！")]
        public string imageUrl { get; set; }
        /// <summary>
        ///  审核人用户id
        /// </summary>
        [Required(ErrorMessage = "userid：用户id必传项！")]
        public string userid { get; set; }
        /// <summary>
        ///  商品id
        /// </summary>
        [Required(ErrorMessage = "fileID：商品id必传项！")]
        public int fileID { get; set; }
        /// <summary>
        ///  名称
        /// </summary>
        [Required(ErrorMessage = "fileID：商品id必传项！")]
        public string fileName { get; set; }
        /// <summary>
        ///  简介
        /// </summary>
        public string fileNote { get; set; }
        /// <summary>
        ///  所属目录
        /// </summary>
        [Required(ErrorMessage = "fileID：商品id必传项！")]
        public int folderID { get; set; }
        /// <summary>
        ///  状态【5=通过、6=不通过】
        /// </summary>
        [Required(ErrorMessage = "fileStatus：状态必传项！")]
        [RegularExpression("^([5,6])$", ErrorMessage = "请正确输入审核状态【5，6】！")]
        public int fileStatus { get; set; }
        /// <summary>
        ///  审核结果
        /// </summary>
        public string approveNote { get; set; }

        /// <summary>
        ///  验证数据
        /// </summary>
        /// <returns></returns>
        public string verifyData()
        {
            string msg = string.Empty;
            if (this.fileID <= 0)
                msg = "商品id必传！";
            if(this.folderID<=0)
                msg = "所属目录id必传！";
            return msg;
        }
    }
}